<?php

namespace app\xwam\validate;

/**
 * 文章验证类
 *
 * @version 2018-1-27 sochishun added.
 */
class ArticleValidate extends \think\Validate {

    // 批量验证
    protected $batch = true;
    // 当前验证的规则
    protected $rule = [
        'title' => 'require',
        'category_id' => 'number',
        'status' => 'number',
    ];
    // 验证字段描述
    protected $field = [
        'title' => '标题',
        'category_id' => '类别',
        'status' => '状态',
    ];
    // 验证场景
    protected $scene = [
        'add' => ['title', 'category_id'],
        'edit' => ['id','title', 'category_id'],
    ];
}
